package com.weibo.action;

import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.weibo.common.SessionManager;
import com.weibo.pojo.Rcollect;
import com.weibo.pojo.Tuser;
import com.weibo.pojo.Tweibo;
import com.weibo.service.IFavouriteService;

public class FavouriteAction extends ActionSupport {
	
	private IFavouriteService favouriteService;
	private List<Tweibo> favouriteList;
	private Integer userId;
	
	public IFavouriteService getFavouriteService() {
		return favouriteService;
	}
	
	public void setFavouriteService(IFavouriteService favouriteService) {
		this.favouriteService = favouriteService;
	}
	
	public List<Tweibo> getFavouriteList() {
		return favouriteList;
	}
	
	public void setFavouriteList(List<Tweibo> favouriteList) {
		this.favouriteList = favouriteList;
	}
	
	public String show() {
		Tuser user = (Tuser)SessionManager.getAttribute("nowUser");
		if(user != null) {
			userId = user.getUserId();
		}
		favouriteList = favouriteService.getFavouriteWeiboList(userId);
		
		return SUCCESS;
	}
	
}
